home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Magazine / Morphos / GCC / os-includeppc / inline / muimaster.h < prev    next >
C/C++ Source or Header  |  1997-02-02  |  12KB  |  478 lines

  1. #ifndef _INLINE_MUIMASTER_H
  2. #define _INLINE_MUIMASTER_H
  3.  
  4. #include <sys/cdefs.h>
  5. #include <inline/stubs.h>
  6.  
  7. __BEGIN_DECLS
  8.  
  9. #ifndef BASE_EXT_DECL
  10. #define BASE_EXT_DECL /*extern struct Library* MUIMasterBase;*/
  11. #endif
  12. #ifndef BASE_PAR_DECL
  13. #define BASE_PAR_DECL
  14. #define BASE_PAR_DECL0 void
  15. #endif
  16. #ifndef BASE_NAME
  17. #define BASE_NAME MUIMasterBase
  18. #endif
  19.  
  20. extern struct Library* MUIMasterBase;
  21.  
  22.   __inline
  23. APTR MUI_AllocAslRequest( BASE_PAR_DECL unsigned long type, struct TagItem *tagList)
  24.  
  25. {
  26.   BASE_EXT_DECL
  27.   register APTR res __asm("d0");
  28.   register struct Library* a6 __asm("a6") = BASE_NAME;
  29.   register unsigned long d0 __asm("d0") = type;
  30.   register struct TagItem* a0 __asm("a0") = tagList;
  31.  
  32.   __asm volatile ("jsr a6@(-0x30)"
  33.   : "=r" (res)
  34.   : "r" (a6), "r" (d0), "r" (a0)
  35.   : "d0","d1", "a0", "a1", "memory" );
  36.   return res;
  37. }
  38.  
  39.   APTR MUI_AllocAslRequestTags(ULONG type, Tag tag1, ...)
  40. {
  41.  return(MUI_AllocAslRequest(type, (struct TagItem *) &tag1));
  42. }
  43.  
  44.  
  45.  
  46. __inline
  47. BOOL MUI_AslRequest( BASE_PAR_DECL APTR requester, struct TagItem *tagList)
  48. {
  49.   BASE_EXT_DECL
  50.   register BOOL res __asm("d0");
  51.   register struct Library* a6 __asm("a6") = BASE_NAME;
  52.   register APTR a0 __asm("a0") = requester;
  53.   register struct TagItem* a1 __asm("a1") = tagList;
  54.  
  55.   __asm volatile ("
  56.   jsr a6@(-0x36)"
  57.   : "=r" (res)
  58.   : "r" (a6), "r" (a0), "r" (a1)
  59.   : "d0", "d1", "a0", "a1" );
  60.   return res;
  61. }
  62.   BOOL MUI_AslRequestTags(APTR req, Tag tag1, ...)
  63. {
  64.  return(MUI_AslRequest(req, (struct TagItem *) &tag1));
  65. }
  66.  
  67.  
  68.  
  69.  
  70. __inline
  71. struct MUI_CustomClass*
  72. MUI_CreateCustomClass( BASE_PAR_DECL struct Library *base, char *supername, struct MUI_CustomClass *supermcc, int datasize, APTR dispatcher)
  73. {
  74.   BASE_EXT_DECL
  75.   register struct MUI_CustomClass* res __asm("d0");
  76.   register struct Library* a6 __asm("a6") = BASE_NAME;
  77.   register struct Library* a0 __asm("a0") = base;
  78.   register char* a1 __asm("a1") = supername;
  79.   register struct MUI_CustomClass* a2 __asm("a2") = supermcc;
  80.   register int d0 __asm("d0") = datasize;
  81.   register APTR a3 __asm("a3") = dispatcher;
  82.  
  83.   __asm volatile ("
  84.   jsr a6@(-0x6c)"
  85.   : "=r" (res)
  86.   : "r" (a6), "r" (a0), "r" (a1), "r" (a2), "r" (d0), "r" (a3)
  87.   : "d0", "d1", "a0", "a1", "a2", "a3" );
  88.   return res;
  89. }
  90.   __inline
  91. BOOL MUI_DeleteCustomClass( BASE_PAR_DECL struct MUI_CustomClass* mcc)
  92. {
  93.   BASE_EXT_DECL
  94.   register BOOL res __asm("d0");
  95.   register struct Library* a6 __asm("a6") = BASE_NAME;
  96.   register struct MUI_CustomClass* a0 __asm("a0") = mcc;
  97.  
  98.   __asm volatile ("
  99.   jsr a6@(-0x72)"
  100.   : "=r" (res)
  101.   : "r" (a6), "r" (a0)
  102.   : "d0", "d1", "a0", "a1" );
  103.   return res;
  104. }
  105.   __inline void MUI_DisposeObject( BASE_PAR_DECL Object *obj)
  106. {
  107.   BASE_EXT_DECL
  108.   register res __asm("d0");
  109.   register struct Library* a6 __asm("a6") = BASE_NAME;
  110.   register Object* a0 __asm("a0") = obj;
  111.  
  112.   __asm volatile ("
  113.   jsr a6@(-0x24)"
  114.   : "=r" (res)
  115.   : "r" (a6), "r" (a0)
  116.   : "d0", "d1", "a0", "a1" );
  117. }
  118.   __inline LONG MUI_Error( BASE_PAR_DECL0 )
  119. {
  120.   BASE_EXT_DECL
  121.   register LONG res __asm("d0");
  122.   register struct Library* a6 __asm("a6") = BASE_NAME;
  123.  
  124.   __asm volatile ("
  125.   jsr a6@(-0x42)"
  126.   : "=r" (res)
  127.   : "r" (a6)
  128.   : "d0", "d1", "a0", "a1" );
  129.   return res;
  130. }
  131.   __inline void MUI_FreeAslRequest( BASE_PAR_DECL APTR requester)
  132. {
  133.   BASE_EXT_DECL
  134.   register res __asm("d0");
  135.   register struct Library* a6 __asm("a6") = BASE_NAME;
  136.   register APTR a0 __asm("a0") = requester;
  137.  
  138.   __asm volatile ("
  139.   jsr a6@(-0x3c)"
  140.   : "=r" (res)
  141.   : "r" (a6), "r" (a0)
  142.   : "d0", "d1", "a0", "a1" );
  143. }
  144.   __inline void MUI_FreeClass( BASE_PAR_DECL struct IClass *classptr)
  145. {
  146.   BASE_EXT_DECL
  147.   register res __asm("d0");
  148.   register struct Library* a6 __asm("a6") = BASE_NAME;
  149.   register struct IClass* a0 __asm("a0")=classptr;
  150.  
  151.   __asm volatile ("
  152.   jsr a6@(-0x54)"
  153.   : "=r" (res)
  154.   : "r" (a6), "r" (a0)
  155.   : "d0", "d1", "a0", "a1" );
  156. }
  157.   __inline struct IClass* MUI_GetClass( BASE_PAR_DECL char *classname)
  158. {
  159.   BASE_EXT_DECL
  160.   register struct IClass* res __asm("d0");
  161.   register struct Library* a6 __asm("a6") = BASE_NAME;
  162.   register char* a0 __asm("a0")=classname;
  163.  
  164.   __asm volatile ("
  165.   jsr a6@(-0x4e)"
  166.   : "=r" (res)
  167.   : "r" (a6), "r" (a0)
  168.   : "d0", "d1", "a0", "a1" );
  169.   return res;
  170. }
  171.   __inline Object* MUI_MakeObjectA( BASE_PAR_DECL LONG type, ULONG *params)
  172. {
  173.   BASE_EXT_DECL
  174.   register Object* res __asm("d0");
  175.   register struct Library* a6 __asm("a6") = BASE_NAME;
  176.   register LONG d0 __asm("d0")=type;
  177.   register ULONG* a0 __asm("a0")=params;
  178.  
  179.   __asm volatile ("
  180.   jsr a6@(-0x78)"
  181.   : "=r" (res)
  182.   : "r" (a6), "r" (d0), "r" (a0)
  183.   : "d0", "d1", "a0", "a1" );
  184.   return res;
  185. }
  186.  
  187.   Object *MUI_MakeObject(LONG type, ...)
  188. {
  189.   return(MUI_MakeObjectA(type, (ULONG *)(((ULONG)&type)+4)));
  190. }
  191.  
  192.   __inline Object* MUI_NewObjectA( BASE_PAR_DECL char *classname, struct TagItem *tags)
  193. {
  194.   BASE_EXT_DECL
  195.   register Object* res __asm("d0");
  196.   register struct Library* a6 __asm("a6") = BASE_NAME;
  197.   register char* a0 __asm("a0") = classname;
  198.   register struct TagItem* a1 __asm("a1")=tags;
  199.  
  200.   __asm volatile ("
  201.   jsr a6@(-0x1e)"
  202.   : "=r" (res)
  203.   : "r" (a6), "r" (a0), "r" (a1)
  204.   : "d0", "d1", "a0", "a1" );
  205.   return res;
  206. }
  207.   Object* MUI_NewObject(char *classname, Tag tag1, ...)
  208. {
  209.  return(MUI_NewObjectA(classname, (struct TagItem *) &tag1));
  210. }
  211.  
  212.  
  213.   __inline void MUI_Redraw( BASE_PAR_DECL Object *obj, ULONG flags)
  214. {
  215.   BASE_EXT_DECL
  216.   register res __asm("d0");
  217.   register struct Library* a6 __asm("a6") = BASE_NAME;
  218.   register Object * a0 __asm("a0")=obj;
  219.   register ULONG d0 __asm("d0")=flags;
  220.  
  221.   __asm volatile ("
  222.   jsr a6@(-0x66)"
  223.   : "=r" (res)
  224.   : "r" (a6), "r" (a0), "r" (d0)
  225.   : "d0", "d1", "a0", "a1" );
  226. }
  227.   __inline void MUI_RejectIDCMP( BASE_PAR_DECL Object *obj, ULONG flags)
  228. {
  229.   BASE_EXT_DECL
  230.   register res __asm("d0");
  231.   register struct Library* a6 __asm("a6") = BASE_NAME;
  232.   register Object* a0 __asm("a0")=obj;
  233.   register ULONG  d0 __asm("d0")=flags;
  234.  
  235.   __asm volatile ("
  236.   jsr a6@(-0x60)"
  237.   : "=r" (res)
  238.   : "r" (a6), "r" (a0), "r" (d0)
  239.   : "d0", "d1", "a0", "a1" );
  240. }
  241.   __inline LONG MUI_RequestA( BASE_PAR_DECL APTR app, APTR win,
  242. LONGBITS flags, char *title,char *gadgets,char *format,APTR params)
  243. {
  244.   BASE_EXT_DECL
  245.   register LONG res __asm("d0");
  246.   register struct Library* a6 __asm("a6") = BASE_NAME;
  247.   register APTR d0 __asm("d0")=app;
  248.   register APTR d1 __asm("d1")=win;
  249.   register LONGBITS d2 __asm("d2")=flags;
  250.   register char * a0 __asm("a0")=title;
  251.   register char * a1 __asm("a1")=gadgets;
  252.   register char * a2 __asm("a2")=format;
  253.   register APTR  a3 __asm("a3")=params;
  254.  
  255.   __asm volatile ("
  256.   jsr a6@(-0x2a)"
  257.   : "=r" (res)
  258.   : "r" (a6), "r" (d0), "r" (d1), "r" (d2), "r" (a0), "r" (a1), "r" (a2), "r" (a3)
  259.   : "d0", "d1", "a0", "a1", "d2", "a2", "a3" );
  260.   return res;
  261. }
  262.  
  263.   LONG MUI_Request(APTR app, APTR win, LONGBITS flags, char *title, char *gadgets, char *format, ...)
  264. {
  265.  return(MUI_RequestA(app, win, flags, title, gadgets, format, (APTR) (((ULONG)&format)+4) ));
  266. }
  267.  
  268.  
  269.  
  270.  
  271.   __inline void MUI_RequestIDCMP( BASE_PAR_DECL Object *obj, ULONG flags)
  272. {
  273.   BASE_EXT_DECL
  274.   register res __asm("d0");
  275.   register struct Library* a6 __asm("a6") = BASE_NAME;
  276.   register Object * a0 __asm("a0")=obj;
  277.   register ULONG  d0 __asm("d0")=flags;
  278.  
  279.   __asm volatile ("
  280.   jsr a6@(-0x5a)"
  281.   : "=r" (res)
  282.   : "r" (a6), "r" (a0), "r" (d0)
  283.   : "d0", "d1", "a0", "a1" );
  284. }
  285.   __inline LONG MUI_SetError( BASE_PAR_DECL LONG num)
  286. {
  287.   BASE_EXT_DECL
  288.   register LONG res __asm("d0");
  289.   register struct Library* a6 __asm("a6") = BASE_NAME;
  290.   register LONG d0 __asm("d0")=num;
  291.  
  292.   __asm volatile ("
  293.   jsr a6@(-0x48)"
  294.   : "=r" (res)
  295.   : "r" (a6), "r" (d0)
  296.   : "d0", "d1", "a0", "a1" );
  297.   return res;
  298. }
  299.  
  300.  
  301.  
  302.  
  303.  
  304. __inline
  305. APTR MUI_AddClipping( BASE_PAR_DECL struct MUI_RenderInfo *mri, WORD left,WORD
  306. top,WORD width,WORD height)
  307. {
  308.   BASE_EXT_DECL
  309.   register APTR res __asm("d0");
  310.   register struct Library* a6 __asm("a6") = BASE_NAME;
  311.   register struct MUI_RenderInfo* a0 __asm("a0") = mri;
  312.   register WORD d0 __asm("d0") = left;
  313.   register WORD d1 __asm("d1") = top;
  314.   register WORD d2 __asm("d2") = width;
  315.   register WORD d3 __asm("d3") = height;
  316.  
  317.   __asm volatile ("
  318.   jsr a6@(-0xa8)"
  319.   : "=r" (res)
  320.   : "r" (a6), "r" (a0), "r" (d0), "r" (d1), "r" (d2), "r" (d3)
  321.   : "d0", "d1", "d2", "d3", "a0", "a1" );
  322.   return res;
  323. }
  324.  
  325. __inline
  326. void MUI_RemoveClipping( BASE_PAR_DECL struct MUI_RenderInfo *mri, APTR handle)
  327. {
  328.   BASE_EXT_DECL
  329.   register res __asm("d0");
  330.   register struct Library* a6 __asm("a6") = BASE_NAME;
  331.   register struct MUI_RenderInfo* a0 __asm("a0") = mri;
  332.   register APTR a1 __asm("a1") = handle;
  333.  
  334.   __asm volatile ("
  335.   jsr a6@(-0xae)"
  336.   : "=r" (res)
  337.   : "r" (a6), "r" (a0), "r" (a1)
  338.   : "d0", "d1", "a0", "a1" );
  339. }
  340.  
  341. __inline
  342. APTR MUI_AddClipRegion( BASE_PAR_DECL struct MUI_RenderInfo *mri, struct 
  343. Region *r)
  344. {
  345.   BASE_EXT_DECL
  346.   register APTR res __asm("d0");
  347.   register struct Library* a6 __asm("a6") = BASE_NAME;
  348.   register struct MUI_RenderInfo* a0 __asm("a0") = mri;
  349.   register struct Region * a1 __asm("a1") = r;
  350.  
  351.   __asm volatile ("
  352.   jsr a6@(-0xb4)"
  353.   : "=r" (res)
  354.   : "r" (a6), "r" (a0), "r" (a1)
  355.   : "d0", "d1", "a0", "a1" );
  356.   return res;
  357. }
  358.  
  359. __inline
  360. void MUI_RemoveClipRegion( BASE_PAR_DECL struct MUI_RenderInfo *mri, APTR 
  361. handle)
  362. {
  363.   BASE_EXT_DECL
  364.   register res __asm("d0");
  365.   register struct Library* a6 __asm("a6") = BASE_NAME;
  366.   register struct MUI_RenderInfo* a0 __asm("a0") = mri;
  367.   register APTR a1 __asm("a1") = handle;
  368.  
  369.   __asm volatile ("
  370.   jsr a6@(-0xba)"
  371.   : "=r" (res)
  372.   : "r" (a6), "r" (a0), "r" (a1)
  373.   : "d0", "d1", "a0", "a1" );
  374. }
  375.  
  376. __inline
  377. BOOL MUI_BeginRefresh( BASE_PAR_DECL struct MUI_RenderInfo *mri, ULONG flags)
  378. {
  379.   BASE_EXT_DECL
  380.   register BOOL res __asm("d0");
  381.   register struct Library* a6 __asm("a6") = BASE_NAME;
  382.   register struct MUI_RenderInfo* a0 __asm("a0") = mri;
  383.   register ULONG d0 __asm("d0") = flags;
  384.  
  385.   __asm volatile ("
  386.   jsr a6@(-0xc0)"
  387.   : "=r" (res)
  388.   : "r" (a6), "r" (a0), "r" (d0)
  389.   : "d0", "d1", "a0", "a1" );
  390.   return res;
  391. }
  392.  
  393. __inline
  394. void MUI_EndRefresh( BASE_PAR_DECL struct MUI_RenderInfo *mri, ULONG flags)
  395. {
  396.   BASE_EXT_DECL
  397.   register res __asm("d0");
  398.   register struct Library* a6 __asm("a6") = BASE_NAME;
  399.   register struct MUI_RenderInfo* a0 __asm("a0") = mri;
  400.   register ULONG d0 __asm("d0") = flags;
  401.  
  402.   __asm volatile ("
  403.   jsr a6@(-0xc6)"
  404.   : "=r" (res)
  405.   : "r" (a6), "r" (a0), "r" (d0)
  406.   : "d0", "d1", "a0", "a1" );
  407. }
  408.  
  409. __inline
  410. LONG MUI_ObtainPen( BASE_PAR_DECL struct MUI_RenderInfo *mri, struct 
  411. MUI_PenSpec *spec,ULONG flags)
  412. {
  413.   BASE_EXT_DECL
  414.   register LONG res __asm("d0");
  415.   register struct Library* a6 __asm("a6") = BASE_NAME;
  416.   register struct MUI_RenderInfo* a0 __asm("a0") = mri;
  417.   register struct MUI_PenSpec * a1 __asm("a1") = spec;
  418.   register ULONG d0 __asm("d0") = flags;
  419.  
  420.   __asm volatile ("
  421.   jsr a6@(-0x9c)"
  422.   : "=r" (res)
  423.   : "r" (a6), "r" (a0), "r" (a1), "r" (d0)
  424.   : "d0", "d1", "a0", "a1" );
  425.   return res;
  426. }
  427.  
  428. __inline
  429. void MUI_ReleasePen( BASE_PAR_DECL struct MUI_RenderInfo *mri, LONG pen)
  430. {
  431.   BASE_EXT_DECL
  432.   register res __asm("d0");
  433.   register struct Library* a6 __asm("a6") = BASE_NAME;
  434.   register struct MUI_RenderInfo* a0 __asm("a0") = mri;
  435.   register LONG d0 __asm("d0") = pen;
  436.  
  437.   __asm volatile ("
  438.   jsr a6@(-0xa2)"
  439.   : "=r" (res)
  440.   : "r" (a6), "r" (a0), "r" (d0)
  441.   : "d0", "d1", "a0", "a1" );
  442. }
  443.  
  444. __inline
  445. BOOL MUI_Layout( BASE_PAR_DECL Object *obj,LONG left,LONG top,LONG width,LONG 
  446. height,ULONG flags)
  447. {
  448.   BASE_EXT_DECL
  449.   register BOOL res __asm("d0");
  450.   register struct Library* a6 __asm("a6") = BASE_NAME;
  451.   register Object * a0 __asm("a0") = obj;
  452.   register LONG d0 __asm("d0") = left;
  453.   register LONG d1 __asm("d1") = top;
  454.   register LONG d2 __asm("d2") = width;
  455.   register LONG d3 __asm("d3") = height;
  456.   register ULONG d4 __asm("d4") = flags;
  457.  
  458.   __asm volatile ("
  459.   jsr a6@(-0x7e)"
  460.   : "=r" (res)
  461.   : "r" (a6), "r" (a0), "r" (d0), "r" (d1), "r" (d2), "r" (d3), "r" (d4)
  462.   : "d0", "d1", "d2", "d3", "d4", "a0", "a1" );
  463.   return res;
  464. }
  465.  
  466.  
  467.  
  468. #undef BASE_EXT_DECL
  469. #undef BASE_PAR_DECL
  470. #undef BASE_PAR_DECL0
  471. #undef BASE_NAME
  472.  
  473. __END_DECLS
  474.  
  475. #endif /* _INLINE_MUIMASTER_H */
  476.  
  477.  
  478.